import Vue from 'vue'
import VueRouter from 'vue-router'
import Admin from '../views/Admin.vue'
import Stores from '../components/stores_and_warehouses/stores.vue'
import Warehouses from '../components/stores_and_warehouses/warehouses.vue'
import Category from '../components/category/primary_category.vue'
import Subclass from '../components/category/subclass.vue'
import Goods from '../components/goods/goods.vue'
import Brand from '../components/goods/brand.vue'
import Attribute from '../components/goods/attribute.vue'
import Channel from '../components/channel/channel.vue'
import Home from '../components/Home.vue'
import Account from '../components/user/account.vue'
import Login from '../views/Login.vue'


Vue.use(VueRouter)

const routes = [
 {
 	 path: '/', 
 	component: Login
 },
  
	{
		path: '/admin', 
		component: Admin,
		children: [
			{path: '/admin', component:Home},
			{path: '/stores_and_warehouses/stores', meta: {title:'仓库管理'}, component:Stores},
			{path: '/stores_and_warehouses/warehouses', meta: {title:'门店管理'}, component:Warehouses},
			{path: '/category/primary', meta: {title:'大类管理'}, component:Category},
			{path: '/category/subclass', meta: {title:'小类管理'}, component:Subclass},
			{path: '/goods/brand', meta: {title:'品牌列表'}, component:Brand},
			{path: '/goods/attribute', meta: {title:'商品属性'}, component:Attribute},
			{path: '/channel/channel', meta: {title:'渠道商'}, component:Channel},
			{path: '/goods/goods', meta: {title:'商品信息'}, component:Goods},
			{path: '/user/account', meta: {title:'用户管理'}, component:Account}
		]
	}
  
]

const router = new VueRouter({
	mode:'history',
	routes
})

export default router
